package com.ogawa.projectcommon.dao

import androidx.room.*
import com.ogawa.projectcommon.bean.DiyBean

@Dao
interface DiyProgramDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    suspend fun insertItem(diyBean: DiyBean)

    @Query("SELECT * FROM diy")
    fun getDiyBeans(): MutableList<DiyBean>

    @Query("SELECT * FROM diy WHERE appIndex=:index AND typeCode=:typeCode")
    fun queryDiyByIndexAndCode(index: Int, typeCode: String): DiyBean?

    @Update
    fun updateDiyInfo(diyBean: DiyBean)

    @Delete
    fun deleteDiyInfo(diyBean: DiyBean)
}